1. Technical Field
The present invention relates to accessing arguments of a probed function, and more particularly to employing a mirror probe handler for seamless access to arguments of a probed function.
2. Related Art
Dynamic probing techniques (e.g., Dprobes, Dynamic Probe Class Library (DPCL), KernInst, Dyninst, and Dtrace) allow on-the-fly interception of a running executable program by planting probes at specified addresses in the program's instruction (or data) stream (e.g., by planting breakpoints or by dynamic code patching), and specifying custom probe handlers to run when those probe points are reached (i.e., hit) during execution. Typical applications of probes include monitoring of specific arguments, ad-hoc tracing of code paths, custom monitoring of system state, tracking complex problems on a live system, debugging timing sensitive problems, fault-injection and dynamic assertion checking. Probe handlers are typically written either in a custom language and interpreted by pre-linked probe handling logic invoked on a probe hit, or in standard programming languages (e.g., C or assembly), and loaded in as object code. Since the probe handler code is outside of the scope of the function being probed, the probe handler cannot refer to arguments of the probed function the way one would do when adding code inline. Instead, special language constructs or interfaces are provided for the probe handler to access function arguments and in some cases, local variables. Implementing these constructs or interfaces requires complex coding related to code analysis, interpretation of debug information, and/or architecture-specific and Application Binary Interface (ABI)-specific knowledge of the compiler's layout of the arguments and calling conventions. Thus, there is a need for an improved technique for accessing arguments of a probed function.